<?php
/**
 * Trainingofferadmin_Model_Trainingofferadmin
 * traing offer admin model
 * @author Adrian Stolarski
 */
class Manageuser_Model_Manageuser implements Manageuser_Model_Decidable, 
        Manageuser_Model_Mainable {
    
    /**
     *
     * @var type $action_handler
     * action handler
     */
    public $action_handler;
    
    /**
     * main()
     * get current decision
     * 
     * @param array $variables
     * @return type $this->model_decision
     */
    public function main(array $variables = null) {
        return $this->model_decision($variables);
    }
    
    /**
     * model_decision()
     * current model decision
     * 
     * @param array $variables
     * @return type current decision
     */
    public function model_decision(array $variables = null) {
        switch($variables['get']['name']){
            case "get_user_list":
                return $this->get_user_list($variables);
                break;
            case "update_user_data":
                $this->update_user_data($variables['post']);
                break;
            default:
                return $this->get_user_list($variables);
                break;
        }
    }
    
    private function get_user_list(array $variables = null){
        $this->action_handler = new ManageUser_Model_Getuserlist;
        return $this->action_handler->main($variables);
    }
    
    private function update_user_data(array $varibles = null){
        $this->action_handler = new Manageuser_Model_Updateuser;
        $this->action_handler->main($varibles);
    }
            
    
}
